﻿using Bricks.Business.Models.ScheduleManagement;
using Bricks.Component.Utils;
using Bricks.Site.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bricks.Business.Service
{
    /// <summary>
    /// 隧道统计服务
    /// </summary>
    public interface ITunnelStatisticsService
    {
        IQueryable<TunnelStatistics> TunnelStatisticses { get; }

        /// <summary>
        /// 获取隧道统计列表
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="contractID"></param>
        /// <returns></returns>
        List<TunnelStatisticsView> GetTunnelTotalList(Guid projectID, Guid contractID);

        /// <summary>
        /// 获取隧道统计明细列表
        /// </summary>
        /// <param name="tunnelID">隧道ID</param>
        /// <param name="newTunnelID">新的隧道ID（拷贝上月数据时使用）</param>
        /// <returns></returns>
        List<TunnelStatisticsDetailView> GetTunnelDetailList(Guid tunnelID, Guid newTunnelID);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="view"></param>
        /// <param name="details"></param>
        /// <returns></returns>
        OperationResult Add(TunnelStatisticsView view);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="view"></param>
        /// <param name="details"></param>
        /// <returns></returns>
        OperationResult Modify(TunnelStatisticsView view);

        /// <summary>
        /// 获取隧道信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        TunnelStatisticsView GetTunnel(Guid id);

        OperationResult Delete(Guid id);

        void Save(TunnelStatisticsView tunnelStatisticsView, List<TunnelStatisticsDetailView> list, bool isUpdateDetails = true);
    }
}
